package com.sunkyc.framework.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sunkyc.commons.entity.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 组织表
 * </p>
 *
 * @author sunkyc
 * @since 2022-05-31
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_dept")
@ApiModel(value="SysDept对象", description="组织表")
public class SysDept  extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "组织id")
    @TableId(value = "dept_id", type = IdType.ASSIGN_ID)
    private Long deptId;

    @ApiModelProperty(value = "上级组织id")
    @NotNull(message = "请选择上级组织")
    private Long parentId;

    @ApiModelProperty(value = "组织名称")
    @NotBlank(message = "请输入组织名称")
    private String deptName;

    @ApiModelProperty(value = "显示顺序")
    private Integer orderNum;

    @ApiModelProperty(value = "负责人")
    private String leader;

    @ApiModelProperty(value = "联系电话")
    private String phone;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "组织状态（0正常 1停用）")
    private String state;

    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    private String delFlag;

    @ApiModelProperty(hidden = true)
    @TableField(exist = false)
    private List<SysDept> children;

}
